<?xml version="1.0" encoding="utf-8"?>
<!-- DWXMLSource="cotizacion.xml" -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
  <xsl:decimal-format name="dollar"
decimal-separator="." grouping-separator=","/>
  <xsl:template match="/ListaPrecios">
  <link href="http://localhost:50860/XMLCss/cotizacionPantalla.css" rel="stylesheet" type="text/css" />
    <div id="ContenedorCotizacion">
      <div style="display:table;">
        <div id="header">Lista de precios</div>
        <div style="margin-top:5px; float:left;  width:660px;"> <img src="http://localhost:50860/XMLCss/logomph.png" align="left" style="margin-right:15px; width:300px"/>AVENIDA BENITO JUAREZ SUR 78 <br/>
          CENTRO<br/>
          TIZAYUCA  HIDALGO, 43800<br/>
          779-796-4527<br />
          ventas@mphardware.com </div>
        <div style="float:left; width:333px; height:90px; display:table;">
          <table id="meta">
            <tbody>
              <tr>
                <td class="meta-head">Fecha</td>
                <td><xsl:call-template name="FormatDate">
                    <xsl:with-param name="DateTime" select="@FechaGeneracion"/>
                    
                  </xsl:call-template></td>
              </tr>
             
                
            </tbody>
          </table>
        </div>
      </div>
      <div>
        <xsl:apply-templates select="Categoria"/>
        
        <xsl:for-each select="Categoria">
        </xsl:for-each>
      </div>
    </div>
  </xsl:template>
  
  
  <xsl:template match="Categoria">
  <xsl:if test="count(Producto) > 0">
    <div >
      <div id="header" style="margin-bottom:0px;"><xsl:value-of select="@NombreCategoria"/></div>
      <table id="meta" style="width:1000px;">
        <tbody>
        <tr>
        <td class="meta-head" style="width:75px;">Clave</td>
        <td class="meta-head" style="width:75px;">Linea</td>
        <td class="meta-head" style="width:75px;">Marca</td>
        <td class="meta-head" style="width:350px; text-align:center;">Descripcion</td>
        <td class="meta-head precio" style="width:55px;">Precio 1</td>
        <td class="meta-head precio" style="width:55px;">Precio 2</td>
        <td class="meta-head precio" style="width:55px;">Precio 3</td>
        </tr>
        <xsl:apply-templates select="Producto"/> 
        <xsl:for-each select="/Categoria/Producto">
        </xsl:for-each>
        </tbody>
      </table>
      
      
    </div>
    </xsl:if>
  </xsl:template>
  

  
  
  <xsl:template match="Producto">
  <tr>
<td ><xsl:value-of select="@Clave"/></td>
        <td ><xsl:value-of select="@Linea"/></td>
        <td ><xsl:value-of select="@Marca"/></td>
        <td><xsl:value-of select="@Descripcion"/></td>
        <td ><span class="price">$<xsl:value-of select="format-number(@Precio1, '#,##0.00','dollar')"/></span></td>
        <td ><span class="price">$<xsl:value-of select="format-number(@Precio2, '#,##0.00','dollar')"/></span></td>
        <td ><span class="price">$<xsl:value-of select="format-number(@Precio3, '#,##0.00','dollar')"/></span></td>
  </tr>
  </xsl:template>
  
  <xsl:template name="FormatDate">
    <xsl:param name="DateTime" />
    <xsl:variable name="year" select="substring($DateTime,1,4)" />
    <xsl:variable name="month-temp" select="substring-after($DateTime,'-')" />
    <xsl:variable name="month" select="substring-before($month-temp,'-')" />
    <xsl:variable name="day-temp" select="substring-after($month-temp,'-')" />
    <xsl:variable name="day" select="substring($day-temp,1,2)" />
    <xsl:variable name="time" select="substring-after($DateTime,'T')" />
    <xsl:variable name="hh" select="substring($time,1,2)" />
    <xsl:variable name="mm" select="substring($time,4,2)" />
    <xsl:variable name="ss" select="substring($time,7,2)" />
    
    <!-- Long DATE FORMAT -->
    
    <xsl:value-of select="$day"/><xsl:value-of select="' de '"/><!--January -->
    <!--January 12 -->
    <xsl:choose>
      <xsl:when test="$month = '1' or $month= '01'">
        Enero
      </xsl:when>
      <xsl:when test="$month = '2' or $month= '02'">
        Febrero
      </xsl:when>
      <xsl:when test="$month= '3' or $month= '03'">
        Marzo
      </xsl:when>
      <xsl:when test="$month= '4' or $month= '04'">
        Abril
      </xsl:when>
      <xsl:when test="$month= '5' or $month= '05'">
        Mayo
      </xsl:when>
      <xsl:when test="$month= '6' or $month= '06'">
        Junio
      </xsl:when>
      <xsl:when test="$month= '7' or $month= '07'">
        Julio
      </xsl:when>
      <xsl:when test="$month= '8' or $month= '08'">
        Augosto
      </xsl:when>
      <xsl:when test="$month= '9' or $month= '09'">
        Septiembre
      </xsl:when>
      <xsl:when test="$month= '10'">
        Octubre
      </xsl:when>
      <xsl:when test="$month= '11'">
        Noviembre
      </xsl:when>
      <xsl:when test="$month= '12'">
        Diciembre
      </xsl:when>
    </xsl:choose>
    <xsl:value-of select="' de'"/><!--January 12,-->
    <xsl:value-of select="' '"/><!--January 12, -->
    <xsl:value-of select="$year"/><!--January 12, 2001-->
    <!--
    <xsl:value-of select="' a las '"/><xsl:value-of select="$hh"/><xsl:value-of select="':'"/><xsl:value-of select="$mm"/><xsl:value-of select="':'"/><xsl:value-of select="$ss"/><xsl:value-of select="' (GMT) '"/>-->
    <!-- END: Long DATE FORMAT -->
    
  </xsl:template>
</xsl:stylesheet>